#ifndef __HAL_FALSH_H__
#define __HAL_FALSH_H__

#include "gbl_types.h"

UINT32 get_appnvm_begin_address(void);

UINT32 get_appnvm_end_address(void);

UINT32 get_appnvm_total_size(void);


#define FLASH_NO_ERROR      0x00
#define FLASH_SECTOR_4K     0x00001000 //4K
#define FLASH_BASE_ADDRESS	0x80000000

/*****************************************************************
* Function: hal_FlashErase4K
*
* Description:
* 	该函数用于擦除4K flash空间。
* 
* Parameters:
* 	None
* 
* Return:
* 	0 :success
*	other :failed
*
*****************************************************************/
int hal_FlashErase4K(unsigned int addr, unsigned int size);

/*****************************************************************
* Function: hal_FlashRead
*
* Description:
* 	该函数用于读取falsh空间。
* 
* Parameters:
* 	None
* 
* Return:
* 	0 :success
*	other :failed
*
*****************************************************************/
int hal_FlashRead(unsigned int addr, unsigned int buf_addr, unsigned int size);

/*****************************************************************
* Function: hal_FlashRead
*
* Description:
* 	该函数用于写入falsh空间。
* 
* Parameters:
* 	None
* 
* Return:
* 	0 :success
*	other :failed
*
*****************************************************************/
int hal_FlashWrite(unsigned int addr, unsigned int buf_addr,unsigned int size);

#endif
